import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        count:10000000
    },
    getters:{
        count(state){
            return "$" + state.count.toLocaleString();
        }
    },
    mutations:{
        increment(state,count){
            state.count += count;
        }
    },
    actions:{
        increment({commit,state},count){
            setTimeout(() => {
                commit("increment",count);
            },1000);
        }
    }
});